#include<iostream>
#include<string>
#include<functional>

using cb_t = std::function<void (int,std::string,uint16_t)>;

class Task
{
public:
    Task(){}

    // 构造函数
    Task(int sock,std::string clientIp,uint16_t clientPort,cb_t cb)
    :_sock(sock),_clientIp(clientIp),_clientPort(clientPort),_cb(cb)
    {
    }

    // 析构函数
    ~Task() {}

    // 仿函数
    void operator()()
    {
        _cb(_sock,_clientIp,_clientPort);
    }

private:
    int _sock;
    std::string _clientIp;
    uint16_t _clientPort;
    cb_t _cb;
};